function getToken() {
  return sessionStorage.token
}

const isProd = process.env.NODE_ENV === 'production'
const getImgUploadApi = () => {
  if (isProd) {
    return `/image/upload?token=${getToken()}`
  }
  return `http://localhost:6001/api/image/upload?token=${getToken()}`
}

const mobileRoutes = [{
  name: '产品中心',
  value: '/products',
}, {
  name: '信用卡',
  value: '/creditCard',
}, {
  name: '个人中心',
  value: '/profile',
}, {
  name: '首页',
  value: '/',
}, {
  name: '文章',
  value: '/iArticle',
  vars: 'id',
}, {
  name: '文章列表',
  value: '/iGeneralList',
  vars: 'id',
}, {
  name: '图文分组',
  value: '/iArticleList',
  vars: 'id',
}]

export default {
  getImgUploadApi,
  isProd,
  mobileRoutes,
}
